<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8"/>
    <title>Traveler Blog -->友链修改</title>
    <link rel="stylesheet" type="text/css" href="/client/css/common.css"/>
    <link rel="stylesheet" type="text/css" href="/client/css/main.css"/>
    <script src="/client/js/jquery-2.1.4.min.js" type="text/javascript"></script>
    <script src="/client/js/jquery-form.js" type="text/javascript"></script>
    <link rel="shortcut icon" href="/client/images/tou.ico">
    <script>
        function editNotice() {
            var title = $("#ltitle").val();
            var details = $("#lpage").val();
            var links=$("#llinks").val();
            var lid = ${link.lid};
            $.ajax({
                url:"/admin/updateLinks.do",
                type:"POST",
                contentType:"application/json",
                data:JSON.stringify({lid:lid,ltitle:title,lpage:details,llinks:links}),
                dataType:"json",
                success:function (data) {
                    alert(data.message);
                    if (data.status == 0){
                        window.location.href = "/admin/findLinks.do";
                    }
                }

            })
        }
    </script>
</head>
<body>
<jsp:include page="/client/head.jsp"/>
<div class="main-wrap">
        <div class="result-content">
            <form action="/admin/updateLinks.do" method="post" id="myform" name="myform">
                <input type="hidden" name="lid" value="${link.lid}" />
                    <p style="margin-left: 30%"><i class="require-red">*</i>标题：<input class="common-text required" id="ltitle" name="ltitle" size="50" value="${link.ltitle}" type="text"></p>
                    <p style="margin-left: 30%">内容：<textarea name="lpage" class="common-textarea" id="lpage" cols="30" style="width: 98%;" rows="10">${link.lpage}</textarea></p>
            `       <p style="margin-left: 30%">链接：<input class="common-text required" id="llinks" name="llinks" size="50" value="${link.llinks}" type="text"></p></br>

                <button class="btn btn-primary btn6 mr10"  type="button" onclick="editNotice()" style="margin-left: 30%">提交</button>
                <button class="btn btn6" onClick="history.go(-1)" type="button" style="margin-left: 33%">返回</button>
            </form>
        </div>
</div>
</body>
</html>
